<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <base href="<%=basePath%>">   
  <title>My JSP 'listNews.JSP' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
        <!--[if IE]>
			<link rel="stylesheet" href="css/fixed_ie.css" type="text/css" />
		<![endif]-->
    <link rel="stylesheet" type="text/css" href="css/960.css">
	<link rel="stylesheet" type="text/css" href="css/reset.css">
	<link rel="stylesheet" type="text/css" href="css/text.css">
	<link rel="stylesheet" type="text/css" href="css/listNews.css">
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery.quickpaginate.js"></script>
	<script type="text/javascript" src="js/jquery.quickpaginate.packed.js"></script>
  </head>
  
  <body>
   <h3> 新闻列表页</h3><br>
    <hr>
    <div class="container_12 menu">
    <ul>
    <li><a href="linkIndexAction.do">发布新闻页</a></li>
    <li><a href="linkListAction.do">新闻列表页</a></li>
    </ul>
    </div>
    <div class="container_12 ">
    <div class="content">
    <div class="listTop">
    <span>序号</span> <span>数据编号</span> <span>类别</span> <span>标题</span> <span>作者</span> <span>发布时间</span>
    
    </div>
    <ul id="shopping_list"></ul>
   <div id="shopping_list_counter"></div>
    <script type="text/javascript"> 
    var flag=0;
    var title;
	$.ajax({
   		url: "showNewsAction.do?c_id=tongzhi",
   		type:'jsonp',
   		async: false,
   		success: function(msg){
   			for(var i=0;i<msg.toString().length;i++){
	     		$("#shopping_list").append("<li><a href="+"showNews.jsp?id="
	     			+msg.news[i].id
	     			+">"
	     			+msg.news[i].title
	     			+msg.news[i].author
	     			+msg.news[i].date.toString()
	     			+"</a>"+"--------"
	     			+"<a href=delNewsAction.do?id="+msg.news[i].id+">删除</a>"
	     			+"</li>"
	     			);
	     	}	
		}
	});

</script>
<script type="text/javascript">
	$("#shopping_list li").quickpaginate({ perpage:15, pager : $("#shopping_list_counter") });
</script>
</div>
</div>
</body>
</html>

